package com.limeng.es.controller;

import com.limeng.es.service.PositionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Controller
public class PositionController {

    @Autowired
    private PositionService positionService;


    // 测试页面
    @GetMapping({"/","/index"})
    public String indexPage(){
        return  "index";
    }

    @RequestMapping("/search/{keyword}/{page}/{pageSize}")
    @ResponseBody
    public List searchByPage(@PathVariable("keyword") String keyword,
                             @PathVariable("page")int page,
                             @PathVariable("pageSize")int pageSize){

        return positionService.searchByPage(keyword,page,pageSize);
    }
}
